// Copyright 2018-2020 Polyaxon, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*
 * Polyaxon SDKs and REST API specification.
 * Polyaxon SDKs and REST API specification.
 *
 * The version of the OpenAPI document: 1.2.1-rc1
 * Contact: contact@polyaxon.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.api;

import org.openapitools.client.ApiCallback;
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.ProgressRequestBody;
import org.openapitools.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import org.threeten.bp.OffsetDateTime;
import org.openapitools.client.model.RuntimeError;
import org.openapitools.client.model.V1ListOrganizationMembersResponse;
import org.openapitools.client.model.V1ListOrganizationsResponse;
import org.openapitools.client.model.V1Organization;
import org.openapitools.client.model.V1OrganizationMember;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class OrganizationsV1Api {
    private ApiClient localVarApiClient;

    public OrganizationsV1Api() {
        this(Configuration.getDefaultApiClient());
    }

    public OrganizationsV1Api(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    /**
     * Build call for createOrganization
     * @param body  (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createOrganizationCall(V1Organization body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/create";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call createOrganizationValidateBeforeCall(V1Organization body, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling createOrganization(Async)");
        }
        

        okhttp3.Call localVarCall = createOrganizationCall(body, _callback);
        return localVarCall;

    }

    /**
     * Create organization
     * 
     * @param body  (required)
     * @return V1Organization
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1Organization createOrganization(V1Organization body) throws ApiException {
        ApiResponse<V1Organization> localVarResp = createOrganizationWithHttpInfo(body);
        return localVarResp.getData();
    }

    /**
     * Create organization
     * 
     * @param body  (required)
     * @return ApiResponse&lt;V1Organization&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1Organization> createOrganizationWithHttpInfo(V1Organization body) throws ApiException {
        okhttp3.Call localVarCall = createOrganizationValidateBeforeCall(body, null);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Create organization (asynchronously)
     * 
     * @param body  (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createOrganizationAsync(V1Organization body, final ApiCallback<V1Organization> _callback) throws ApiException {

        okhttp3.Call localVarCall = createOrganizationValidateBeforeCall(body, _callback);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for createOrganizationMember
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createOrganizationMemberCall(String owner, V1OrganizationMember body, String email, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/members"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (email != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call createOrganizationMemberValidateBeforeCall(String owner, V1OrganizationMember body, String email, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling createOrganizationMember(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling createOrganizationMember(Async)");
        }
        

        okhttp3.Call localVarCall = createOrganizationMemberCall(owner, body, email, _callback);
        return localVarCall;

    }

    /**
     * Create organization member
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @return V1OrganizationMember
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1OrganizationMember createOrganizationMember(String owner, V1OrganizationMember body, String email) throws ApiException {
        ApiResponse<V1OrganizationMember> localVarResp = createOrganizationMemberWithHttpInfo(owner, body, email);
        return localVarResp.getData();
    }

    /**
     * Create organization member
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @return ApiResponse&lt;V1OrganizationMember&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1OrganizationMember> createOrganizationMemberWithHttpInfo(String owner, V1OrganizationMember body, String email) throws ApiException {
        okhttp3.Call localVarCall = createOrganizationMemberValidateBeforeCall(owner, body, email, null);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Create organization member (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call createOrganizationMemberAsync(String owner, V1OrganizationMember body, String email, final ApiCallback<V1OrganizationMember> _callback) throws ApiException {

        okhttp3.Call localVarCall = createOrganizationMemberValidateBeforeCall(owner, body, email, _callback);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for deleteOrganization
     * @param owner Owner of the namespace (required)
     * @param usage Owner usage query param. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call deleteOrganizationCall(String owner, String usage, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (usage != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("usage", usage));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call deleteOrganizationValidateBeforeCall(String owner, String usage, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling deleteOrganization(Async)");
        }
        

        okhttp3.Call localVarCall = deleteOrganizationCall(owner, usage, _callback);
        return localVarCall;

    }

    /**
     * Delete organization
     * 
     * @param owner Owner of the namespace (required)
     * @param usage Owner usage query param. (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public void deleteOrganization(String owner, String usage) throws ApiException {
        deleteOrganizationWithHttpInfo(owner, usage);
    }

    /**
     * Delete organization
     * 
     * @param owner Owner of the namespace (required)
     * @param usage Owner usage query param. (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Void> deleteOrganizationWithHttpInfo(String owner, String usage) throws ApiException {
        okhttp3.Call localVarCall = deleteOrganizationValidateBeforeCall(owner, usage, null);
        return localVarApiClient.execute(localVarCall);
    }

    /**
     * Delete organization (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param usage Owner usage query param. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call deleteOrganizationAsync(String owner, String usage, final ApiCallback<Void> _callback) throws ApiException {

        okhttp3.Call localVarCall = deleteOrganizationValidateBeforeCall(owner, usage, _callback);
        localVarApiClient.executeAsync(localVarCall, _callback);
        return localVarCall;
    }
    /**
     * Build call for deleteOrganizationInvitation
     * @param owner Owner of the namespace (required)
     * @param memberUser User. (optional)
     * @param memberUserEmail Read-only User email. (optional)
     * @param memberRole Role. (optional)
     * @param memberCreatedAt Optional time when the entity was created. (optional)
     * @param memberUpdatedAt Optional last time the entity was updated. (optional)
     * @param email Optional email. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call deleteOrganizationInvitationCall(String owner, String memberUser, String memberUserEmail, String memberRole, OffsetDateTime memberCreatedAt, OffsetDateTime memberUpdatedAt, String email, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/invitations"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (memberUser != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("member.user", memberUser));
        }

        if (memberUserEmail != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("member.user_email", memberUserEmail));
        }

        if (memberRole != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("member.role", memberRole));
        }

        if (memberCreatedAt != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("member.created_at", memberCreatedAt));
        }

        if (memberUpdatedAt != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("member.updated_at", memberUpdatedAt));
        }

        if (email != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call deleteOrganizationInvitationValidateBeforeCall(String owner, String memberUser, String memberUserEmail, String memberRole, OffsetDateTime memberCreatedAt, OffsetDateTime memberUpdatedAt, String email, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling deleteOrganizationInvitation(Async)");
        }
        

        okhttp3.Call localVarCall = deleteOrganizationInvitationCall(owner, memberUser, memberUserEmail, memberRole, memberCreatedAt, memberUpdatedAt, email, _callback);
        return localVarCall;

    }

    /**
     * Delete organization invitation details
     * 
     * @param owner Owner of the namespace (required)
     * @param memberUser User. (optional)
     * @param memberUserEmail Read-only User email. (optional)
     * @param memberRole Role. (optional)
     * @param memberCreatedAt Optional time when the entity was created. (optional)
     * @param memberUpdatedAt Optional last time the entity was updated. (optional)
     * @param email Optional email. (optional)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public void deleteOrganizationInvitation(String owner, String memberUser, String memberUserEmail, String memberRole, OffsetDateTime memberCreatedAt, OffsetDateTime memberUpdatedAt, String email) throws ApiException {
        deleteOrganizationInvitationWithHttpInfo(owner, memberUser, memberUserEmail, memberRole, memberCreatedAt, memberUpdatedAt, email);
    }

    /**
     * Delete organization invitation details
     * 
     * @param owner Owner of the namespace (required)
     * @param memberUser User. (optional)
     * @param memberUserEmail Read-only User email. (optional)
     * @param memberRole Role. (optional)
     * @param memberCreatedAt Optional time when the entity was created. (optional)
     * @param memberUpdatedAt Optional last time the entity was updated. (optional)
     * @param email Optional email. (optional)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Void> deleteOrganizationInvitationWithHttpInfo(String owner, String memberUser, String memberUserEmail, String memberRole, OffsetDateTime memberCreatedAt, OffsetDateTime memberUpdatedAt, String email) throws ApiException {
        okhttp3.Call localVarCall = deleteOrganizationInvitationValidateBeforeCall(owner, memberUser, memberUserEmail, memberRole, memberCreatedAt, memberUpdatedAt, email, null);
        return localVarApiClient.execute(localVarCall);
    }

    /**
     * Delete organization invitation details (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param memberUser User. (optional)
     * @param memberUserEmail Read-only User email. (optional)
     * @param memberRole Role. (optional)
     * @param memberCreatedAt Optional time when the entity was created. (optional)
     * @param memberUpdatedAt Optional last time the entity was updated. (optional)
     * @param email Optional email. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call deleteOrganizationInvitationAsync(String owner, String memberUser, String memberUserEmail, String memberRole, OffsetDateTime memberCreatedAt, OffsetDateTime memberUpdatedAt, String email, final ApiCallback<Void> _callback) throws ApiException {

        okhttp3.Call localVarCall = deleteOrganizationInvitationValidateBeforeCall(owner, memberUser, memberUserEmail, memberRole, memberCreatedAt, memberUpdatedAt, email, _callback);
        localVarApiClient.executeAsync(localVarCall, _callback);
        return localVarCall;
    }
    /**
     * Build call for deleteOrganizationMember
     * @param owner Owner of the namespace (required)
     * @param user Memeber under namesapce (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call deleteOrganizationMemberCall(String owner, String user, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/members/{user}"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()))
            .replaceAll("\\{" + "user" + "\\}", localVarApiClient.escapeString(user.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call deleteOrganizationMemberValidateBeforeCall(String owner, String user, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling deleteOrganizationMember(Async)");
        }
        
        // verify the required parameter 'user' is set
        if (user == null) {
            throw new ApiException("Missing the required parameter 'user' when calling deleteOrganizationMember(Async)");
        }
        

        okhttp3.Call localVarCall = deleteOrganizationMemberCall(owner, user, _callback);
        return localVarCall;

    }

    /**
     * Delete organization member details
     * 
     * @param owner Owner of the namespace (required)
     * @param user Memeber under namesapce (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public void deleteOrganizationMember(String owner, String user) throws ApiException {
        deleteOrganizationMemberWithHttpInfo(owner, user);
    }

    /**
     * Delete organization member details
     * 
     * @param owner Owner of the namespace (required)
     * @param user Memeber under namesapce (required)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Void> deleteOrganizationMemberWithHttpInfo(String owner, String user) throws ApiException {
        okhttp3.Call localVarCall = deleteOrganizationMemberValidateBeforeCall(owner, user, null);
        return localVarApiClient.execute(localVarCall);
    }

    /**
     * Delete organization member details (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param user Memeber under namesapce (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call deleteOrganizationMemberAsync(String owner, String user, final ApiCallback<Void> _callback) throws ApiException {

        okhttp3.Call localVarCall = deleteOrganizationMemberValidateBeforeCall(owner, user, _callback);
        localVarApiClient.executeAsync(localVarCall, _callback);
        return localVarCall;
    }
    /**
     * Build call for getOrganization
     * @param owner Owner of the namespace (required)
     * @param usage Owner usage query param. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getOrganizationCall(String owner, String usage, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (usage != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("usage", usage));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getOrganizationValidateBeforeCall(String owner, String usage, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling getOrganization(Async)");
        }
        

        okhttp3.Call localVarCall = getOrganizationCall(owner, usage, _callback);
        return localVarCall;

    }

    /**
     * Get organization
     * 
     * @param owner Owner of the namespace (required)
     * @param usage Owner usage query param. (optional)
     * @return V1Organization
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1Organization getOrganization(String owner, String usage) throws ApiException {
        ApiResponse<V1Organization> localVarResp = getOrganizationWithHttpInfo(owner, usage);
        return localVarResp.getData();
    }

    /**
     * Get organization
     * 
     * @param owner Owner of the namespace (required)
     * @param usage Owner usage query param. (optional)
     * @return ApiResponse&lt;V1Organization&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1Organization> getOrganizationWithHttpInfo(String owner, String usage) throws ApiException {
        okhttp3.Call localVarCall = getOrganizationValidateBeforeCall(owner, usage, null);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get organization (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param usage Owner usage query param. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getOrganizationAsync(String owner, String usage, final ApiCallback<V1Organization> _callback) throws ApiException {

        okhttp3.Call localVarCall = getOrganizationValidateBeforeCall(owner, usage, _callback);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getOrganizationInvitation
     * @param owner Owner of the namespace (required)
     * @param memberUser User. (optional)
     * @param memberUserEmail Read-only User email. (optional)
     * @param memberRole Role. (optional)
     * @param memberCreatedAt Optional time when the entity was created. (optional)
     * @param memberUpdatedAt Optional last time the entity was updated. (optional)
     * @param email Optional email. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getOrganizationInvitationCall(String owner, String memberUser, String memberUserEmail, String memberRole, OffsetDateTime memberCreatedAt, OffsetDateTime memberUpdatedAt, String email, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/invitations"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (memberUser != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("member.user", memberUser));
        }

        if (memberUserEmail != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("member.user_email", memberUserEmail));
        }

        if (memberRole != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("member.role", memberRole));
        }

        if (memberCreatedAt != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("member.created_at", memberCreatedAt));
        }

        if (memberUpdatedAt != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("member.updated_at", memberUpdatedAt));
        }

        if (email != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getOrganizationInvitationValidateBeforeCall(String owner, String memberUser, String memberUserEmail, String memberRole, OffsetDateTime memberCreatedAt, OffsetDateTime memberUpdatedAt, String email, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling getOrganizationInvitation(Async)");
        }
        

        okhttp3.Call localVarCall = getOrganizationInvitationCall(owner, memberUser, memberUserEmail, memberRole, memberCreatedAt, memberUpdatedAt, email, _callback);
        return localVarCall;

    }

    /**
     * Get organization invitation details
     * 
     * @param owner Owner of the namespace (required)
     * @param memberUser User. (optional)
     * @param memberUserEmail Read-only User email. (optional)
     * @param memberRole Role. (optional)
     * @param memberCreatedAt Optional time when the entity was created. (optional)
     * @param memberUpdatedAt Optional last time the entity was updated. (optional)
     * @param email Optional email. (optional)
     * @return V1OrganizationMember
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1OrganizationMember getOrganizationInvitation(String owner, String memberUser, String memberUserEmail, String memberRole, OffsetDateTime memberCreatedAt, OffsetDateTime memberUpdatedAt, String email) throws ApiException {
        ApiResponse<V1OrganizationMember> localVarResp = getOrganizationInvitationWithHttpInfo(owner, memberUser, memberUserEmail, memberRole, memberCreatedAt, memberUpdatedAt, email);
        return localVarResp.getData();
    }

    /**
     * Get organization invitation details
     * 
     * @param owner Owner of the namespace (required)
     * @param memberUser User. (optional)
     * @param memberUserEmail Read-only User email. (optional)
     * @param memberRole Role. (optional)
     * @param memberCreatedAt Optional time when the entity was created. (optional)
     * @param memberUpdatedAt Optional last time the entity was updated. (optional)
     * @param email Optional email. (optional)
     * @return ApiResponse&lt;V1OrganizationMember&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1OrganizationMember> getOrganizationInvitationWithHttpInfo(String owner, String memberUser, String memberUserEmail, String memberRole, OffsetDateTime memberCreatedAt, OffsetDateTime memberUpdatedAt, String email) throws ApiException {
        okhttp3.Call localVarCall = getOrganizationInvitationValidateBeforeCall(owner, memberUser, memberUserEmail, memberRole, memberCreatedAt, memberUpdatedAt, email, null);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get organization invitation details (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param memberUser User. (optional)
     * @param memberUserEmail Read-only User email. (optional)
     * @param memberRole Role. (optional)
     * @param memberCreatedAt Optional time when the entity was created. (optional)
     * @param memberUpdatedAt Optional last time the entity was updated. (optional)
     * @param email Optional email. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getOrganizationInvitationAsync(String owner, String memberUser, String memberUserEmail, String memberRole, OffsetDateTime memberCreatedAt, OffsetDateTime memberUpdatedAt, String email, final ApiCallback<V1OrganizationMember> _callback) throws ApiException {

        okhttp3.Call localVarCall = getOrganizationInvitationValidateBeforeCall(owner, memberUser, memberUserEmail, memberRole, memberCreatedAt, memberUpdatedAt, email, _callback);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getOrganizationMember
     * @param owner Owner of the namespace (required)
     * @param user Memeber under namesapce (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getOrganizationMemberCall(String owner, String user, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/members/{user}"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()))
            .replaceAll("\\{" + "user" + "\\}", localVarApiClient.escapeString(user.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getOrganizationMemberValidateBeforeCall(String owner, String user, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling getOrganizationMember(Async)");
        }
        
        // verify the required parameter 'user' is set
        if (user == null) {
            throw new ApiException("Missing the required parameter 'user' when calling getOrganizationMember(Async)");
        }
        

        okhttp3.Call localVarCall = getOrganizationMemberCall(owner, user, _callback);
        return localVarCall;

    }

    /**
     * Get organization member details
     * 
     * @param owner Owner of the namespace (required)
     * @param user Memeber under namesapce (required)
     * @return V1OrganizationMember
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1OrganizationMember getOrganizationMember(String owner, String user) throws ApiException {
        ApiResponse<V1OrganizationMember> localVarResp = getOrganizationMemberWithHttpInfo(owner, user);
        return localVarResp.getData();
    }

    /**
     * Get organization member details
     * 
     * @param owner Owner of the namespace (required)
     * @param user Memeber under namesapce (required)
     * @return ApiResponse&lt;V1OrganizationMember&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1OrganizationMember> getOrganizationMemberWithHttpInfo(String owner, String user) throws ApiException {
        okhttp3.Call localVarCall = getOrganizationMemberValidateBeforeCall(owner, user, null);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get organization member details (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param user Memeber under namesapce (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getOrganizationMemberAsync(String owner, String user, final ApiCallback<V1OrganizationMember> _callback) throws ApiException {

        okhttp3.Call localVarCall = getOrganizationMemberValidateBeforeCall(owner, user, _callback);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for getOrganizationSettings
     * @param owner Owner of the namespace (required)
     * @param organizationUser User. (optional)
     * @param organizationUserEmail Read-only User email. (optional)
     * @param organizationName Name. (optional)
     * @param organizationIsPublic Optional flag to tell if this organization is public. (optional)
     * @param organizationCreatedAt Optional time when the entity was created. (optional)
     * @param organizationUpdatedAt Optional last time the entity was updated. (optional)
     * @param organizationRole Current user&#39;s role in this org. (optional)
     * @param organizationQueue Default queue. (optional)
     * @param organizationPreset Default preset. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getOrganizationSettingsCall(String owner, String organizationUser, String organizationUserEmail, String organizationName, Boolean organizationIsPublic, OffsetDateTime organizationCreatedAt, OffsetDateTime organizationUpdatedAt, String organizationRole, String organizationQueue, String organizationPreset, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/settings"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (organizationUser != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("organization.user", organizationUser));
        }

        if (organizationUserEmail != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("organization.user_email", organizationUserEmail));
        }

        if (organizationName != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("organization.name", organizationName));
        }

        if (organizationIsPublic != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("organization.is_public", organizationIsPublic));
        }

        if (organizationCreatedAt != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("organization.created_at", organizationCreatedAt));
        }

        if (organizationUpdatedAt != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("organization.updated_at", organizationUpdatedAt));
        }

        if (organizationRole != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("organization.role", organizationRole));
        }

        if (organizationQueue != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("organization.queue", organizationQueue));
        }

        if (organizationPreset != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("organization.preset", organizationPreset));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getOrganizationSettingsValidateBeforeCall(String owner, String organizationUser, String organizationUserEmail, String organizationName, Boolean organizationIsPublic, OffsetDateTime organizationCreatedAt, OffsetDateTime organizationUpdatedAt, String organizationRole, String organizationQueue, String organizationPreset, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling getOrganizationSettings(Async)");
        }
        

        okhttp3.Call localVarCall = getOrganizationSettingsCall(owner, organizationUser, organizationUserEmail, organizationName, organizationIsPublic, organizationCreatedAt, organizationUpdatedAt, organizationRole, organizationQueue, organizationPreset, _callback);
        return localVarCall;

    }

    /**
     * Get organization settings
     * 
     * @param owner Owner of the namespace (required)
     * @param organizationUser User. (optional)
     * @param organizationUserEmail Read-only User email. (optional)
     * @param organizationName Name. (optional)
     * @param organizationIsPublic Optional flag to tell if this organization is public. (optional)
     * @param organizationCreatedAt Optional time when the entity was created. (optional)
     * @param organizationUpdatedAt Optional last time the entity was updated. (optional)
     * @param organizationRole Current user&#39;s role in this org. (optional)
     * @param organizationQueue Default queue. (optional)
     * @param organizationPreset Default preset. (optional)
     * @return V1Organization
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1Organization getOrganizationSettings(String owner, String organizationUser, String organizationUserEmail, String organizationName, Boolean organizationIsPublic, OffsetDateTime organizationCreatedAt, OffsetDateTime organizationUpdatedAt, String organizationRole, String organizationQueue, String organizationPreset) throws ApiException {
        ApiResponse<V1Organization> localVarResp = getOrganizationSettingsWithHttpInfo(owner, organizationUser, organizationUserEmail, organizationName, organizationIsPublic, organizationCreatedAt, organizationUpdatedAt, organizationRole, organizationQueue, organizationPreset);
        return localVarResp.getData();
    }

    /**
     * Get organization settings
     * 
     * @param owner Owner of the namespace (required)
     * @param organizationUser User. (optional)
     * @param organizationUserEmail Read-only User email. (optional)
     * @param organizationName Name. (optional)
     * @param organizationIsPublic Optional flag to tell if this organization is public. (optional)
     * @param organizationCreatedAt Optional time when the entity was created. (optional)
     * @param organizationUpdatedAt Optional last time the entity was updated. (optional)
     * @param organizationRole Current user&#39;s role in this org. (optional)
     * @param organizationQueue Default queue. (optional)
     * @param organizationPreset Default preset. (optional)
     * @return ApiResponse&lt;V1Organization&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1Organization> getOrganizationSettingsWithHttpInfo(String owner, String organizationUser, String organizationUserEmail, String organizationName, Boolean organizationIsPublic, OffsetDateTime organizationCreatedAt, OffsetDateTime organizationUpdatedAt, String organizationRole, String organizationQueue, String organizationPreset) throws ApiException {
        okhttp3.Call localVarCall = getOrganizationSettingsValidateBeforeCall(owner, organizationUser, organizationUserEmail, organizationName, organizationIsPublic, organizationCreatedAt, organizationUpdatedAt, organizationRole, organizationQueue, organizationPreset, null);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get organization settings (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param organizationUser User. (optional)
     * @param organizationUserEmail Read-only User email. (optional)
     * @param organizationName Name. (optional)
     * @param organizationIsPublic Optional flag to tell if this organization is public. (optional)
     * @param organizationCreatedAt Optional time when the entity was created. (optional)
     * @param organizationUpdatedAt Optional last time the entity was updated. (optional)
     * @param organizationRole Current user&#39;s role in this org. (optional)
     * @param organizationQueue Default queue. (optional)
     * @param organizationPreset Default preset. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getOrganizationSettingsAsync(String owner, String organizationUser, String organizationUserEmail, String organizationName, Boolean organizationIsPublic, OffsetDateTime organizationCreatedAt, OffsetDateTime organizationUpdatedAt, String organizationRole, String organizationQueue, String organizationPreset, final ApiCallback<V1Organization> _callback) throws ApiException {

        okhttp3.Call localVarCall = getOrganizationSettingsValidateBeforeCall(owner, organizationUser, organizationUserEmail, organizationName, organizationIsPublic, organizationCreatedAt, organizationUpdatedAt, organizationRole, organizationQueue, organizationPreset, _callback);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for listOrganizationMemberNames
     * @param owner Owner of the namespace (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search search. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listOrganizationMemberNamesCall(String owner, Integer offset, Integer limit, String sort, String query, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/members/names"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (offset != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset));
        }

        if (limit != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit));
        }

        if (sort != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
        }

        if (query != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("query", query));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call listOrganizationMemberNamesValidateBeforeCall(String owner, Integer offset, Integer limit, String sort, String query, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling listOrganizationMemberNames(Async)");
        }
        

        okhttp3.Call localVarCall = listOrganizationMemberNamesCall(owner, offset, limit, sort, query, _callback);
        return localVarCall;

    }

    /**
     * Get organization member names
     * 
     * @param owner Owner of the namespace (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search search. (optional)
     * @return V1ListOrganizationMembersResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1ListOrganizationMembersResponse listOrganizationMemberNames(String owner, Integer offset, Integer limit, String sort, String query) throws ApiException {
        ApiResponse<V1ListOrganizationMembersResponse> localVarResp = listOrganizationMemberNamesWithHttpInfo(owner, offset, limit, sort, query);
        return localVarResp.getData();
    }

    /**
     * Get organization member names
     * 
     * @param owner Owner of the namespace (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search search. (optional)
     * @return ApiResponse&lt;V1ListOrganizationMembersResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1ListOrganizationMembersResponse> listOrganizationMemberNamesWithHttpInfo(String owner, Integer offset, Integer limit, String sort, String query) throws ApiException {
        okhttp3.Call localVarCall = listOrganizationMemberNamesValidateBeforeCall(owner, offset, limit, sort, query, null);
        Type localVarReturnType = new TypeToken<V1ListOrganizationMembersResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get organization member names (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search search. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listOrganizationMemberNamesAsync(String owner, Integer offset, Integer limit, String sort, String query, final ApiCallback<V1ListOrganizationMembersResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = listOrganizationMemberNamesValidateBeforeCall(owner, offset, limit, sort, query, _callback);
        Type localVarReturnType = new TypeToken<V1ListOrganizationMembersResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for listOrganizationMembers
     * @param owner Owner of the namespace (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search search. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listOrganizationMembersCall(String owner, Integer offset, Integer limit, String sort, String query, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/members"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (offset != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("offset", offset));
        }

        if (limit != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("limit", limit));
        }

        if (sort != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("sort", sort));
        }

        if (query != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("query", query));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call listOrganizationMembersValidateBeforeCall(String owner, Integer offset, Integer limit, String sort, String query, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling listOrganizationMembers(Async)");
        }
        

        okhttp3.Call localVarCall = listOrganizationMembersCall(owner, offset, limit, sort, query, _callback);
        return localVarCall;

    }

    /**
     * Get organization members
     * 
     * @param owner Owner of the namespace (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search search. (optional)
     * @return V1ListOrganizationMembersResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1ListOrganizationMembersResponse listOrganizationMembers(String owner, Integer offset, Integer limit, String sort, String query) throws ApiException {
        ApiResponse<V1ListOrganizationMembersResponse> localVarResp = listOrganizationMembersWithHttpInfo(owner, offset, limit, sort, query);
        return localVarResp.getData();
    }

    /**
     * Get organization members
     * 
     * @param owner Owner of the namespace (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search search. (optional)
     * @return ApiResponse&lt;V1ListOrganizationMembersResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1ListOrganizationMembersResponse> listOrganizationMembersWithHttpInfo(String owner, Integer offset, Integer limit, String sort, String query) throws ApiException {
        okhttp3.Call localVarCall = listOrganizationMembersValidateBeforeCall(owner, offset, limit, sort, query, null);
        Type localVarReturnType = new TypeToken<V1ListOrganizationMembersResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Get organization members (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param offset Pagination offset. (optional)
     * @param limit Limit size. (optional)
     * @param sort Sort to order the search. (optional)
     * @param query Query filter the search search. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listOrganizationMembersAsync(String owner, Integer offset, Integer limit, String sort, String query, final ApiCallback<V1ListOrganizationMembersResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = listOrganizationMembersValidateBeforeCall(owner, offset, limit, sort, query, _callback);
        Type localVarReturnType = new TypeToken<V1ListOrganizationMembersResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for listOrganizationNames
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listOrganizationNamesCall(final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/names";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call listOrganizationNamesValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = listOrganizationNamesCall(_callback);
        return localVarCall;

    }

    /**
     * List organizations names
     * 
     * @return V1ListOrganizationsResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1ListOrganizationsResponse listOrganizationNames() throws ApiException {
        ApiResponse<V1ListOrganizationsResponse> localVarResp = listOrganizationNamesWithHttpInfo();
        return localVarResp.getData();
    }

    /**
     * List organizations names
     * 
     * @return ApiResponse&lt;V1ListOrganizationsResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1ListOrganizationsResponse> listOrganizationNamesWithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = listOrganizationNamesValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<V1ListOrganizationsResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * List organizations names (asynchronously)
     * 
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listOrganizationNamesAsync(final ApiCallback<V1ListOrganizationsResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = listOrganizationNamesValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<V1ListOrganizationsResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for listOrganizations
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listOrganizationsCall(final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/list";

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call listOrganizationsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
        

        okhttp3.Call localVarCall = listOrganizationsCall(_callback);
        return localVarCall;

    }

    /**
     * List organizations
     * 
     * @return V1ListOrganizationsResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1ListOrganizationsResponse listOrganizations() throws ApiException {
        ApiResponse<V1ListOrganizationsResponse> localVarResp = listOrganizationsWithHttpInfo();
        return localVarResp.getData();
    }

    /**
     * List organizations
     * 
     * @return ApiResponse&lt;V1ListOrganizationsResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1ListOrganizationsResponse> listOrganizationsWithHttpInfo() throws ApiException {
        okhttp3.Call localVarCall = listOrganizationsValidateBeforeCall(null);
        Type localVarReturnType = new TypeToken<V1ListOrganizationsResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * List organizations (asynchronously)
     * 
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call listOrganizationsAsync(final ApiCallback<V1ListOrganizationsResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = listOrganizationsValidateBeforeCall(_callback);
        Type localVarReturnType = new TypeToken<V1ListOrganizationsResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for organizationPlan
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call organizationPlanCall(String owner, V1Organization body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/plan"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call organizationPlanValidateBeforeCall(String owner, V1Organization body, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling organizationPlan(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling organizationPlan(Async)");
        }
        

        okhttp3.Call localVarCall = organizationPlanCall(owner, body, _callback);
        return localVarCall;

    }

    /**
     * Organization plan
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @return V1Organization
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1Organization organizationPlan(String owner, V1Organization body) throws ApiException {
        ApiResponse<V1Organization> localVarResp = organizationPlanWithHttpInfo(owner, body);
        return localVarResp.getData();
    }

    /**
     * Organization plan
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @return ApiResponse&lt;V1Organization&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1Organization> organizationPlanWithHttpInfo(String owner, V1Organization body) throws ApiException {
        okhttp3.Call localVarCall = organizationPlanValidateBeforeCall(owner, body, null);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Organization plan (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call organizationPlanAsync(String owner, V1Organization body, final ApiCallback<V1Organization> _callback) throws ApiException {

        okhttp3.Call localVarCall = organizationPlanValidateBeforeCall(owner, body, _callback);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for patchOrganization
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call patchOrganizationCall(String owner, V1Organization body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call patchOrganizationValidateBeforeCall(String owner, V1Organization body, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling patchOrganization(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling patchOrganization(Async)");
        }
        

        okhttp3.Call localVarCall = patchOrganizationCall(owner, body, _callback);
        return localVarCall;

    }

    /**
     * Patch organization
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @return V1Organization
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1Organization patchOrganization(String owner, V1Organization body) throws ApiException {
        ApiResponse<V1Organization> localVarResp = patchOrganizationWithHttpInfo(owner, body);
        return localVarResp.getData();
    }

    /**
     * Patch organization
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @return ApiResponse&lt;V1Organization&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1Organization> patchOrganizationWithHttpInfo(String owner, V1Organization body) throws ApiException {
        okhttp3.Call localVarCall = patchOrganizationValidateBeforeCall(owner, body, null);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Patch organization (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call patchOrganizationAsync(String owner, V1Organization body, final ApiCallback<V1Organization> _callback) throws ApiException {

        okhttp3.Call localVarCall = patchOrganizationValidateBeforeCall(owner, body, _callback);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for patchOrganizationInvitation
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call patchOrganizationInvitationCall(String owner, V1OrganizationMember body, String email, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/invitations"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (email != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call patchOrganizationInvitationValidateBeforeCall(String owner, V1OrganizationMember body, String email, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling patchOrganizationInvitation(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling patchOrganizationInvitation(Async)");
        }
        

        okhttp3.Call localVarCall = patchOrganizationInvitationCall(owner, body, email, _callback);
        return localVarCall;

    }

    /**
     * Patch organization invitation
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @return V1OrganizationMember
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1OrganizationMember patchOrganizationInvitation(String owner, V1OrganizationMember body, String email) throws ApiException {
        ApiResponse<V1OrganizationMember> localVarResp = patchOrganizationInvitationWithHttpInfo(owner, body, email);
        return localVarResp.getData();
    }

    /**
     * Patch organization invitation
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @return ApiResponse&lt;V1OrganizationMember&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1OrganizationMember> patchOrganizationInvitationWithHttpInfo(String owner, V1OrganizationMember body, String email) throws ApiException {
        okhttp3.Call localVarCall = patchOrganizationInvitationValidateBeforeCall(owner, body, email, null);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Patch organization invitation (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call patchOrganizationInvitationAsync(String owner, V1OrganizationMember body, String email, final ApiCallback<V1OrganizationMember> _callback) throws ApiException {

        okhttp3.Call localVarCall = patchOrganizationInvitationValidateBeforeCall(owner, body, email, _callback);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for patchOrganizationMember
     * @param owner Owner of the namespace (required)
     * @param memberUser User (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call patchOrganizationMemberCall(String owner, String memberUser, V1OrganizationMember body, String email, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/members/{member.user}"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()))
            .replaceAll("\\{" + "member.user" + "\\}", localVarApiClient.escapeString(memberUser.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (email != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call patchOrganizationMemberValidateBeforeCall(String owner, String memberUser, V1OrganizationMember body, String email, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling patchOrganizationMember(Async)");
        }
        
        // verify the required parameter 'memberUser' is set
        if (memberUser == null) {
            throw new ApiException("Missing the required parameter 'memberUser' when calling patchOrganizationMember(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling patchOrganizationMember(Async)");
        }
        

        okhttp3.Call localVarCall = patchOrganizationMemberCall(owner, memberUser, body, email, _callback);
        return localVarCall;

    }

    /**
     * Patch organization member
     * 
     * @param owner Owner of the namespace (required)
     * @param memberUser User (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @return V1OrganizationMember
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1OrganizationMember patchOrganizationMember(String owner, String memberUser, V1OrganizationMember body, String email) throws ApiException {
        ApiResponse<V1OrganizationMember> localVarResp = patchOrganizationMemberWithHttpInfo(owner, memberUser, body, email);
        return localVarResp.getData();
    }

    /**
     * Patch organization member
     * 
     * @param owner Owner of the namespace (required)
     * @param memberUser User (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @return ApiResponse&lt;V1OrganizationMember&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1OrganizationMember> patchOrganizationMemberWithHttpInfo(String owner, String memberUser, V1OrganizationMember body, String email) throws ApiException {
        okhttp3.Call localVarCall = patchOrganizationMemberValidateBeforeCall(owner, memberUser, body, email, null);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Patch organization member (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param memberUser User (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call patchOrganizationMemberAsync(String owner, String memberUser, V1OrganizationMember body, String email, final ApiCallback<V1OrganizationMember> _callback) throws ApiException {

        okhttp3.Call localVarCall = patchOrganizationMemberValidateBeforeCall(owner, memberUser, body, email, _callback);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for patchOrganizationSettings
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call patchOrganizationSettingsCall(String owner, V1Organization body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/settings"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call patchOrganizationSettingsValidateBeforeCall(String owner, V1Organization body, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling patchOrganizationSettings(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling patchOrganizationSettings(Async)");
        }
        

        okhttp3.Call localVarCall = patchOrganizationSettingsCall(owner, body, _callback);
        return localVarCall;

    }

    /**
     * Patch oranization settings
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @return V1Organization
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1Organization patchOrganizationSettings(String owner, V1Organization body) throws ApiException {
        ApiResponse<V1Organization> localVarResp = patchOrganizationSettingsWithHttpInfo(owner, body);
        return localVarResp.getData();
    }

    /**
     * Patch oranization settings
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @return ApiResponse&lt;V1Organization&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1Organization> patchOrganizationSettingsWithHttpInfo(String owner, V1Organization body) throws ApiException {
        okhttp3.Call localVarCall = patchOrganizationSettingsValidateBeforeCall(owner, body, null);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Patch oranization settings (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call patchOrganizationSettingsAsync(String owner, V1Organization body, final ApiCallback<V1Organization> _callback) throws ApiException {

        okhttp3.Call localVarCall = patchOrganizationSettingsValidateBeforeCall(owner, body, _callback);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for updateOrganization
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call updateOrganizationCall(String owner, V1Organization body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call updateOrganizationValidateBeforeCall(String owner, V1Organization body, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling updateOrganization(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling updateOrganization(Async)");
        }
        

        okhttp3.Call localVarCall = updateOrganizationCall(owner, body, _callback);
        return localVarCall;

    }

    /**
     * Update organization
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @return V1Organization
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1Organization updateOrganization(String owner, V1Organization body) throws ApiException {
        ApiResponse<V1Organization> localVarResp = updateOrganizationWithHttpInfo(owner, body);
        return localVarResp.getData();
    }

    /**
     * Update organization
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @return ApiResponse&lt;V1Organization&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1Organization> updateOrganizationWithHttpInfo(String owner, V1Organization body) throws ApiException {
        okhttp3.Call localVarCall = updateOrganizationValidateBeforeCall(owner, body, null);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Update organization (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call updateOrganizationAsync(String owner, V1Organization body, final ApiCallback<V1Organization> _callback) throws ApiException {

        okhttp3.Call localVarCall = updateOrganizationValidateBeforeCall(owner, body, _callback);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for updateOrganizationInvitation
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call updateOrganizationInvitationCall(String owner, V1OrganizationMember body, String email, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/invitations"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (email != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call updateOrganizationInvitationValidateBeforeCall(String owner, V1OrganizationMember body, String email, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling updateOrganizationInvitation(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling updateOrganizationInvitation(Async)");
        }
        

        okhttp3.Call localVarCall = updateOrganizationInvitationCall(owner, body, email, _callback);
        return localVarCall;

    }

    /**
     * Update organization invitation
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @return V1OrganizationMember
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1OrganizationMember updateOrganizationInvitation(String owner, V1OrganizationMember body, String email) throws ApiException {
        ApiResponse<V1OrganizationMember> localVarResp = updateOrganizationInvitationWithHttpInfo(owner, body, email);
        return localVarResp.getData();
    }

    /**
     * Update organization invitation
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @return ApiResponse&lt;V1OrganizationMember&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1OrganizationMember> updateOrganizationInvitationWithHttpInfo(String owner, V1OrganizationMember body, String email) throws ApiException {
        okhttp3.Call localVarCall = updateOrganizationInvitationValidateBeforeCall(owner, body, email, null);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Update organization invitation (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call updateOrganizationInvitationAsync(String owner, V1OrganizationMember body, String email, final ApiCallback<V1OrganizationMember> _callback) throws ApiException {

        okhttp3.Call localVarCall = updateOrganizationInvitationValidateBeforeCall(owner, body, email, _callback);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for updateOrganizationMember
     * @param owner Owner of the namespace (required)
     * @param memberUser User (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call updateOrganizationMemberCall(String owner, String memberUser, V1OrganizationMember body, String email, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/members/{member.user}"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()))
            .replaceAll("\\{" + "member.user" + "\\}", localVarApiClient.escapeString(memberUser.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        if (email != null) {
            localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email));
        }

        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call updateOrganizationMemberValidateBeforeCall(String owner, String memberUser, V1OrganizationMember body, String email, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling updateOrganizationMember(Async)");
        }
        
        // verify the required parameter 'memberUser' is set
        if (memberUser == null) {
            throw new ApiException("Missing the required parameter 'memberUser' when calling updateOrganizationMember(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling updateOrganizationMember(Async)");
        }
        

        okhttp3.Call localVarCall = updateOrganizationMemberCall(owner, memberUser, body, email, _callback);
        return localVarCall;

    }

    /**
     * Update organization member
     * 
     * @param owner Owner of the namespace (required)
     * @param memberUser User (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @return V1OrganizationMember
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1OrganizationMember updateOrganizationMember(String owner, String memberUser, V1OrganizationMember body, String email) throws ApiException {
        ApiResponse<V1OrganizationMember> localVarResp = updateOrganizationMemberWithHttpInfo(owner, memberUser, body, email);
        return localVarResp.getData();
    }

    /**
     * Update organization member
     * 
     * @param owner Owner of the namespace (required)
     * @param memberUser User (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @return ApiResponse&lt;V1OrganizationMember&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1OrganizationMember> updateOrganizationMemberWithHttpInfo(String owner, String memberUser, V1OrganizationMember body, String email) throws ApiException {
        okhttp3.Call localVarCall = updateOrganizationMemberValidateBeforeCall(owner, memberUser, body, email, null);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Update organization member (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param memberUser User (required)
     * @param body Organization body (required)
     * @param email Optional email. (optional)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call updateOrganizationMemberAsync(String owner, String memberUser, V1OrganizationMember body, String email, final ApiCallback<V1OrganizationMember> _callback) throws ApiException {

        okhttp3.Call localVarCall = updateOrganizationMemberValidateBeforeCall(owner, memberUser, body, email, _callback);
        Type localVarReturnType = new TypeToken<V1OrganizationMember>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for updateOrganizationSettings
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call updateOrganizationSettingsCall(String owner, V1Organization body, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = body;

        // create path and map variables
        String localVarPath = "/api/v1/orgs/{owner}/settings"
            .replaceAll("\\{" + "owner" + "\\}", localVarApiClient.escapeString(owner.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();
        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "ApiKey" };
        return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call updateOrganizationSettingsValidateBeforeCall(String owner, V1Organization body, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'owner' is set
        if (owner == null) {
            throw new ApiException("Missing the required parameter 'owner' when calling updateOrganizationSettings(Async)");
        }
        
        // verify the required parameter 'body' is set
        if (body == null) {
            throw new ApiException("Missing the required parameter 'body' when calling updateOrganizationSettings(Async)");
        }
        

        okhttp3.Call localVarCall = updateOrganizationSettingsCall(owner, body, _callback);
        return localVarCall;

    }

    /**
     * Update organization settings
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @return V1Organization
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public V1Organization updateOrganizationSettings(String owner, V1Organization body) throws ApiException {
        ApiResponse<V1Organization> localVarResp = updateOrganizationSettingsWithHttpInfo(owner, body);
        return localVarResp.getData();
    }

    /**
     * Update organization settings
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @return ApiResponse&lt;V1Organization&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<V1Organization> updateOrganizationSettingsWithHttpInfo(String owner, V1Organization body) throws ApiException {
        okhttp3.Call localVarCall = updateOrganizationSettingsValidateBeforeCall(owner, body, null);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Update organization settings (asynchronously)
     * 
     * @param owner Owner of the namespace (required)
     * @param body Organization body (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> A successful response. </td><td>  -  </td></tr>
        <tr><td> 204 </td><td> No content. </td><td>  -  </td></tr>
        <tr><td> 403 </td><td> You don&#39;t have permission to access the resource. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> Resource does not exist. </td><td>  -  </td></tr>
        <tr><td> 0 </td><td> An unexpected error response </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call updateOrganizationSettingsAsync(String owner, V1Organization body, final ApiCallback<V1Organization> _callback) throws ApiException {

        okhttp3.Call localVarCall = updateOrganizationSettingsValidateBeforeCall(owner, body, _callback);
        Type localVarReturnType = new TypeToken<V1Organization>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
}
